# NOT RUN {
lmeFit <- lme(log(serBilir) ~ ns(year, 2), data = pbc2,
random = ~ ns(year, 2) | id)
survFit <- coxph(Surv(years, status2) ~ 1, data = pbc2.id, x = TRUE)
jointFit <- jointModelBayes(lmeFit, survFit, timeVar = "year")
fitted(jointFit, process = "Event")
residuals(jointFit, type = "Subject", standardized = TRUE)
# }
Run the code above in your browser using DataLab